import Carousel from "./Carousel";
import CarItem from "./Carousel/Item.vue";
import Button from "./Button"
import Switch from "./Switch"
import Dialog from "./Dialog"
import Drawer from "./Drawer"
import Collapse from "./Collapse"
import CollapseItem from "./Collapse/item.vue"
import Select from "./Select"
import Option from "./Select/option"
import Input from "./Input"
import Radio from "./Radio"
import RadioGroup from "./Radio/group"
import Checkbox from "./Checkbox"
import CheckboxGroup from "./Checkbox/group"
import Tabs from "./Tabs"
import TabPane from "./Tabs/pane"

let ComponentsAll = {
  Carousel,
  CarItem,
  Button,
  Switch,
  Dialog,
  Drawer,
  Collapse,
  CollapseItem,
  Select,
  Option,
  Input,
  Radio,
  RadioGroup,
  Checkbox,
  CheckboxGroup,
  Tabs,
  TabPane
}

const install = function (Vue, options) {
  if (options && options.components) {
    options.components.map(key => {
      Vue.component(ComponentsAll[key].name, ComponentsAll[key]);
    })
  } else {
    Object.values(ComponentsAll).forEach(item => {
      Vue.component(item.name, item);
    });
  }
};

export default install;